package com.example.study.utils;

import lombok.Data;

/**
 * 返回结果工具类
 *
 * @author duckquan
 */
@Data
public class ResultUtil<T> {

    private String code;
    private String message;
    private Object data;

    private static final String successCode = "000";
    private static final String successMessage = "操作成功";

    public static <T> ResultUtil<T> successResult(Object data) {
        ResultUtil<T> result = new ResultUtil();
        result.setCode(successCode);
        result.setMessage(successMessage);
        result.setData(data);
        return result;
    }

}
